﻿#include"UnOrderedSet.h"
#include"UnOrderedMap.h"
#include"HashTable.h"
int main()
{
	bit::UnorderedSet<int> us;
	us.insert(3);
	us.insert(1);
	us.insert(3);
	us.insert(9);
	us.insert(13);
	us.insert(23);

	bit::UnorderedSet<int>::iterator it = us.begin();
	while (it != us.end())
	{
		// 不能修改key
		//*it += 10;
		cout << *it << " ";
		++it;
	}
	cout << endl;

	bit::UnorderedMap<string,string> dict;
	dict.insert(make_pair("sort", "排序"));
	dict.insert(make_pair("left", "左边"));
	dict.insert(make_pair("insert", "插入"));
	dict.insert(make_pair("sort", "xxx"));

	bit::UnorderedMap<string, string>::iterator dit = dict.begin();
	while (dit != dict.end())
	{
		// 不能修改key
		//dit->first += 'x';
		dit->second += 'x';
		cout << dit->first << ":" <<dit->second  << endl;

		++dit;
	}
	cout << endl;

	dict["sort"] = "排序";
	dict["insert"] = "插入";
	dict["string"] = "字符串";
	dict["right"];

	for (auto& kv : dict)
	{
		cout << kv.first << ":" << kv.second << endl;
	}

	return 0;
}